import 'package:flutter/material.dart';
import 'package:flutter_news/common/values/values.dart';

/// 透明背景 AppBar
AppBar transparentAppBar({
  required BuildContext context,
  required Widget title,
  required Widget leading,
  List<Widget>? actions,
}) {
  return AppBar(
    backgroundColor: Colors.transparent,
    // 设置阴影为 0
    elevation: 0,
    title: Center(
      child: title,
    ),
    // 设置返回按钮
    // leading: IconButton(
    //   onPressed: () {
    //     Navigator.pop(context);
    //   },
    //   icon: const Icon(
    //     Icons.arrow_back,
    //     color: AppColors.primaryText,
    //   ),
    // ),
    leading: leading,
    // 设置导航栏右侧的按钮
    actions: actions,
  );
}
